﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ScrumTime.Models;

namespace ScrumTime.Services
{
    public class UsabilityAffectedAcceptanceCriteriaService
    {
        public static UsabilityAffectedAcceptanceCriteria GetUsabilityAffectedAcceptanceCriteriaById(ScrumTimeEntities scrumTimeEntities, int id)
        {
            UsabilityAffectedAcceptanceCriteria usabilityAffectedAC= null;

            var results = from t in scrumTimeEntities.UsabilityAffectedAcceptanceCriterias
                          where t.UsabilityAffectedAcceptanceCriteriaId == id
                          select t;
            if (results.Count() > 0)
                usabilityAffectedAC = results.First<UsabilityAffectedAcceptanceCriteria>();
            else
                usabilityAffectedAC = new UsabilityAffectedAcceptanceCriteria();
            return usabilityAffectedAC;
        }
    }
}